package com.estar.assistsurvy.thread;

import com.estar.assistsurvy.constant.Constants;
import com.estar.assistsurvy.entity.RequestLog;
import com.estar.assistsurvy.entity.ResponseRgt;
import android.content.Context;
import android.os.Handler;
import android.util.Log;

public class LoginThread extends BaseThread {

	private RequestLog requestLog;

	public LoginThread(Context context, Handler handler, RequestLog requestLog) {
		super(context, handler);
		this.requestLog = requestLog;
	}
	
	@Override
	public void run() {
		// TODO Auto-generated method stub
		url_str=Constants.NAMESPACE+Constants.LOGIN_SERVICE;
		json=gson.toJson(requestLog);
		postRequest(url_str, json);
		if(result!=null){
			Log.i("wl", "登录返回值"+result);
			ResponseRgt login=new ResponseRgt();
			login=gson.fromJson(result, ResponseRgt.class);
			msg.what=0;
			msg.obj=login;
			msg.sendToTarget();
		}
	}
}
